android.ndk.multinetwork

@file multinetwork.h

Members

Aliases

net_handle_t
alias net_handle_t = c_ulong

The corresponding C type for android.net.Network#getNetworkHandle() return values. The Java signed long value can be safely cast to a net_handle_t:

Enums

ResNsendFlags
enum ResNsendFlags

Possible values of the flags argument to android_res_nsend and android_res_nquery. Values are ORed together.

Functions

android_getaddrinfofornetwork
int android_getaddrinfofornetwork(net_handle_t network, const(char)* node, const(char)* service, const(addrinfo)* hints, addrinfo** res)

Perform hostname resolution via the DNS servers associated with |network|.

android_res_cancel
void android_res_cancel(int nsend_fd)

Attempts to cancel the in-progress query associated with the |nsend_fd| descriptor.

android_res_nquery
int android_res_nquery(net_handle_t network, const(char)* dname, int ns_class, int ns_type, uint flags)

Look up the {|ns_class|, |ns_type|} Resource Record (RR) associated with Domain Name |dname| on the given |network|. The typical value for |ns_class| is ns_c_in, while |type| can be any record type (for instance, ns_t_aaaa or ns_t_txt). |flags| is a additional config to control actual querying behavior, see ResNsendFlags for detail.

android_res_nresult
int android_res_nresult(int fd, int* rcode, ubyte* answer, size_t anslen)

Read a result for the query associated with the |fd| descriptor. Closes |fd| before returning.

android_res_nsend
int android_res_nsend(net_handle_t network, const(ubyte)* msg, size_t msglen, uint flags)

Issue the query |msg| on the given |network|. |flags| is a additional config to control actual querying behavior, see ResNsendFlags for detail.

android_setprocnetwork
int android_setprocnetwork(net_handle_t network)

Binds the current process to |network|. All sockets created in the future (and not explicitly bound via android_setsocknetwork()) will be bound to |network|. All host name resolutions will be limited to |network| as well. Note that if the network identified by |network| ever disconnects, all sockets created in this way will cease to work and all host name resolutions will fail. This is by design so an application doesn't accidentally use sockets it thinks are still bound to a particular network.

android_setsocknetwork
int android_setsocknetwork(net_handle_t network, int fd)

Set the network to be used by the given socket file descriptor.

Manifest constants

NETWORK_UNSPECIFIED
enum NETWORK_UNSPECIFIED;

The value NETWORK_UNSPECIFIED indicates no specific network.

Meta